<!doctype html>
<html class="no-js" lang="">

<head>
  <meta charset="utf-8" />
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  <link rel="icon" href="favicon.ico" type="image/x-icon">
  <title>登录-默笙后台管理系统</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/assets/js/vendor/bootstrap/bootstrap.min.css">
  <!-- CSS Files -->
  <link href="__PUBLIC__/assets/css/main.css" rel="stylesheet">
</head>

<body id="falcon" class="authentication">
  <div class="wrapper">
    <div class="header header-filter" style="background-image: url('__PUBLIC__/assets/images/login-bg.jpg'); background-size: cover; background-position: top center;">
      <div class="container">
        <div class="row">
          <div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 text-center">
            <div class="card card-signup">
              <form class="form">
                <div class="header header-primary text-center">
                  <h4>登录</h4>
                  <div class="social-line">
                    <a href="javascript:void(0);" class="btn btn-just-icon">
                      <i class="fa fa-facebook-square"></i>
                    </a>
                    <a  href="javascript:void(0);" class="btn btn-just-icon">
                      <i class="fa fa-twitter"></i>
                    </a>
                    <a href="javascript:void(0);" class="btn btn-just-icon">
                      <i class="fa fa-google-plus"></i>
                    </a>
                  </div>
                </div>
                <h3 class="mt-0">默笙</h3>
                <p class="help-block">为了更好的遇见</p>
                <div class="content">
                  <div class="form-group">
                    <input type="text" id="username" class="form-control underline-input" placeholder="Enter Your Username">
                  </div>
                  <div class="form-group">
                    <input type="password" id="password" placeholder="Password..." class="form-control underline-input">
                  </div>
                  <div class="form-group">
                    <input type="text" id="code" placeholder="Code..." class="form-control underline-input">
                     <img src="{:U('Login/verify')}" alt="" onclick="this.src='{:U("Login/verify")}'" title="看不清，换一张">
                  </div>
                  
                </div>
                <div class="footer text-center">
                  <a id="denglu" class="btn btn-info btn-raised">登录</a>
                </div>
              
              </form>
            </div>
          </div>
        </div>
      </div>
      <footer class="footer mt-20">
        <div class="container">
          <div class="col-lg-12 text-center">
            <a href="https://www.tecms.net/" target="_blank" class="text-uppercase text-white">Create by Mosheng</a>
            <div class="copyright text-white mt-20"> &copy; 2018, made with
              <i class="fa fa-heart heart"></i> by
              <a href="https://www.tecms.net/" target="_blank">mosheng</a>
            </div>
          </div>
        </div>
      </footer>
    </div>
  </div>
  <!--  Vendor JavaScripts -->
  <script src="__PUBLIC__/assets/bundles/libscripts.bundle.js"></script>
  
  <script src="__PUBLIC__/assets/jquery.min.js"></script>
  <script src="__PUBLIC__/assets/layer.js"></script>
  <script src="__PUBLIC__/assets/bundles/mainscripts.bundle.js"></script>
  <!-- Custom Js -->
  <script type="text/javascript">
    $("#denglu").click(function () {
        var e = 0;
        var name = $("#username").val();
        var pwd = $("#password").val();
        var code = $("#code").val();
        
        if (name == "") {
            layer.msg('请输入用户名', function () {
                //关闭后的操作
                return false;
            });
            return false;
        }
        
        if (pwd == "") {
            layer.msg('请输入密码', function () {
                //关闭后的操作
                return false;
            });
            return false;
        }
        if (pwd.length < 6) {
            layer.msg('密码长度不正确   ', function () {
                //关闭后的操作
                return false;
            });
            return false;
        }
        if (e == 0) {
            $.post("{:U('login/index')}", { name: name, pass: pwd, code:code}, function (data) {
                if (data.status == '1') {
                    layer.alert(data.info, { icon: 6 });//layer.msg('不开心。。', {icon: 5});
                    window.location.href = data.url;
                } else {
                    layer.alert(data.info, { icon: 5 });
                }
            })
        }

    })
</script>

</body>
</html>